<template>
	<view class="page" style="padding-bottom: 50rpx;">
		<view class="topVue">
			<view class="safeVue" :style="{ height: statusBarHeight + 'rpx' }"></view>
			<view class="flex align-center padding-row30" :style="{ height: barHeight + 'rpx', top: statusBarHeight + 'rpx' }" @click="$tools.back()">
				<image src="../../static/back.png" style="width: 48rpx; height: 48rpx;"></image>
				<text style="line-height: 1; color: #454545; font-weight: 600; font-size: 32rpx; padding-left: 20rpx;">我的粉丝</text>
			</view>
		</view>
		<view :style="{ height: statusBarHeight + barHeight + 'rpx' }"></view>
		<u-empty text="列表为空" mode="list" v-if="list.length===0" margin-top="200"></u-empty>
		<view class="item flex-between align-center margin20 padding-row30" v-for="(item, index) in list" :key="index">
			<text style="color: #454545; line-height: 1;">ID：{{item.id}}</text>
			<view class="flex align-center">
				<text style="color: #454545; line-height: 1; padding-left: 30rpx;">{{item.name || "--"}}</text>
				<text style="padding-left: 30rpx;" :style="{color: item.orderType==1? 'red': 'green'}">{{item.eightyOneCount}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				statusBarHeight: 0,
				barHeight: 0,
				list: []
			}
		},
		onLoad() {
			let that = this;
			wx.getSystemInfo({
				success(res) {
					let deviceWidth = wx.getSystemInfoSync().windowWidth
					that.statusBarHeight = Number(res.statusBarHeight) * ( 750 / deviceWidth ) 
					let menuButtonInfo = wx.getMenuButtonBoundingClientRect()
					let barHeight = menuButtonInfo.height + (menuButtonInfo.top - res.statusBarHeight) * 2
					that.barHeight = Number(barHeight) * ( 750 / deviceWidth )
				},
			});
		},
		async onShow() {
			await this.getList()
		},
		methods:{
			async getList(){
				const res = await this.$request("/api/WeChat/fansList", {}, "GET")
				if(res.code===200){
					this.list = res.data
				}
			}
		}
	}
</script>

<style lang="less" scoped>
	.topVue {
		width: 100%;
		background: #fff;
		position: fixed;
		left: 0;
		top: 0;
		z-index: 99;
		.safeVue {
			width: 100%;
		}
	}
	.item {
		width: 690rpx;
		height: 92rpx;
		background: #fff;
		border-radius: 20rpx;
		box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(178, 178, 178, 0.25), inset 0rpx 8rpx 8rpx 0rpx rgba(255, 255, 255, 0.25);
	}
</style>